import SearchBar from './Business/SearchBar'
import AuditAttr from './Business/AuditAttr'
import AuditReport from './Business/AuditReport'
import DownPopoverBtn from './Business/DownPopoverBtn'

import Card from './Base/Card'
import Text from './Base/Text'
import Button from './Base/Button'
import Table from './Base/Table'

import EcahrtsMap from './Echarts/Map'
import EcahrtsBar from './Echarts/Bar'
import EcahrtsArea from './Echarts/Area'

// 全量导出
export default {
  SearchBar,
  AuditAttr,
  AuditReport,
  DownPopoverBtn,
  Card,
  Text,
  Button,
  Table,
  EcahrtsMap,
  EcahrtsBar,
  EcahrtsArea
}

// 按需导出
export {
  SearchBar,
  AuditAttr,
  AuditReport,
  DownPopoverBtn,
  Card,
  Text,
  Button,
  Table,
  EcahrtsMap,
  EcahrtsBar,
  EcahrtsArea
}

// 业务组件默认属性
const BusinessDataModel = {
  SearchBar: {
    type: 'SearchBar',
    name: '搜索栏',
    attrs: {
      base: {
        titleName: '',
        remote: true
      },
      data: {
        url: '',
        method: 'GET',
        auto: false,
        responseFunc: 'return res;',
        params: {},
        headers: {}
      },
      events: {},
      options: {}
    }
  },
  AuditAttr: {
    type: 'AuditAttr',
    name: '审计点属性',
    attrs: {
      base: {
        remote: true
      },
      data: {
        url: '',
        method: 'GET',
        auto: false,
        responseFunc: 'return res;',
        params: {},
        headers: {}
      },
      events: {},
      options: {}
    }
  },
  AuditReport: {
    type: 'AuditReport',
    name: '审计报告',
    attrs: {
      base: {
        remote: true
      },
      data: {
        url: '',
        method: 'GET',
        auto: false,
        responseFunc: 'return res;',
        params: {},
        headers: {}
      },
      events: {},
      options: {}
    }
  },
  DownPopoverBtn: {
    type: 'DownPopoverBtn',
    name: '下载',
    attrs: {
      base: {
        linkUrl: ''
      },
      data: {
        url: '',
        openUrl: '',
        method: 'GET',
        auto: false,
        responseFunc: 'return res;',
        params: {},
        headers: {}
      },
      events: {},
      options: {}
    }
  }
}

// 基础组件默认属性
const BaseWidgetDataModel = {
  Card: {
    type: 'Card',
    name: '基础卡片',
    attrs: {
      base: {
        style: '',
        shadow: 'always',
        bodyStyle: 10,
        title: '标题'
      },
      data: {},
      events: {},
      options: {}
    }
  },
  Text: {
    type: 'Text',
    name: '文字',
    attrs: {
      base: {
        style: '',
        defaultValue: '这是一段默认文字。',
        remote: true
      },
      data: {
        url: '',
        method: 'GET',
        auto: false,
        responseFunc: 'return res;',
        params: {},
        headers: {}
      },
      events: {},
      options: {}
    }
  },
  Button: {
    type: 'Button',
    name: '按钮',
    attrs: {
      base: {
        style: '',
        buttonSize: 'small',
        buttonType: 'primary',
        buttonPlain: false,
        buttonRound: false,
        buttonCircle: false,
        buttonName: 'Button',
        buttonIcon: '',
        optType: '默认',
        linkUrl: ''
      },
      data: {
        openUrl: ''
      },
      events: {},
      options: {}
    }
  },
  Table: {
    type: 'Table',
    name: '表格',
    attrs: {
      base: {
        style: '',
        title: true,
        titleName: '标题',
        remote: true
      },
      data: {
        url: '',
        openUrl: '',
        method: 'GET',
        auto: false,
        responseFunc: 'return res;',
        params: {},
        headers: {}
      },
      events: {},
      options: {}
    }
  }
}

// 图表组件默认属性
const EchartWidgetDataModel = {
  EcahrtsMap: {
    type: 'EcahrtsMap',
    name: '地图',
    attrs: {
      base: {
        style: '',
        title: true,
        titleName: '标题',
        remote: true
      },
      data: {
        url: '',
        method: 'GET',
        auto: false,
        responseFunc: 'return res;',
        params: {},
        headers: {}
      },
      events: {},
      options: {}
    }
  },
  EcahrtsBar: {
    type: 'EcahrtsBar',
    name: '柱状图',
    attrs: {
      base: {
        style: '',
        title: true,
        titleName: '标题',
        remote: true
      },
      data: {
        url: '',
        method: 'GET',
        auto: false,
        responseFunc: 'return res;',
        params: {},
        headers: {}
      },
      events: {},
      options: {}
    }
  },
  EcahrtsArea: {
    type: 'EcahrtsArea',
    name: '面积图',
    attrs: {
      base: {
        style: '',
        title: true,
        titleName: '标题',
        remote: true
      },
      data: {
        url: '',
        method: 'GET',
        auto: false,
        responseFunc: 'return res;',
        params: {},
        headers: {}
      },
      events: {},
      options: {}
    }
  }
}

// 导出组件默认属性
export const WidgetDataModel = {
  ...BusinessDataModel,
  ...BaseWidgetDataModel,
  ...EchartWidgetDataModel
}
